var minderUtil={
     getNodeBox:function(node,type){
         var nodeList=node.getNodeList();
         var minder=node.getMinder();
         var induces=[];
         if(type=='induce'){
             nodeList.forEach(function(node){
                 minder.induces.forEach(function(induce){
                    if(induce.node==node){
                        induces.push(induce);
                    }
                 })
           });
           var items=nodeList.concat(induces);
          
         }else{
            items=nodeList;
         }
         var x0=0;
         var y0=0;
         var x1=0;
         var y1=0;
         items.forEach(function(item,i){
            var pos=item.getPosition();
            var box=item.getBoundingRect();
            if(i==0){
                 x0=pos.x;
		         y0=pos.y;
		         x1=pos.x+box.width;
		         y1=pos.y+box.height;
            }else{
            	if(!item.visible){
                   return;
            	}
            	if(pos.x<x0){
                    x0=pos.x;
                }
                if(pos.y<y0){
                    y0=pos.y;
                }
                if((pos.x+box.width)>x1){
                   x1=pos.x+box.width;
                }
                if((pos.y+box.height)>y1){
                   y1=pos.y+box.height;
                }
            }
            
         });
         
         return {
         	x0:x0,
         	y0:y0,
         	x1:x1,
         	y1:y1,
         	width:x1-x0,
         	height:y1-y0
         }
     },
};
export default minderUtil;